<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title th:text="${title+' - 登录'}">云宝零批商城管理后台 - 登录</title>
    <link rel="stylesheet" href="http://cdn.viptool.cn/lib/bootstrap/3.3.5/css/bootstrap.min.css">
    <link href="../resource/hotui/css/font-awesome.min.css" th:href="@{/resource/hotui/css/font-awesome.min.css}"
          rel="stylesheet">
    <link href="../resource/hotui/css/animate.min.css" th:href="@{/resource/hotui/css/animate.min.css}"
          rel="stylesheet">
    <link href="../resource/hotui/css/style.min-1.0.8.css" th:href="@{/resource/hotui/css/style.min-1.0.8.css}"
          rel="stylesheet">
    <link href="../resource/hotui/css/login.min.css" th:href="@{/resource/hotui/css/login.min.css}" rel="stylesheet">
    <link rel="icon" href="../resource/hotui/img/favicon.ico" type="image/x-icon">
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location
        }
    </script>

</head>

<body class="signin">
<div class="signinpanel">
    <div class="row">
        <div class="col-sm-7">
            <div class="signin-info">
                <!--<img style="width: 350px; height: auto;" src="../resource/hotui/img/knife_logo.png">-->
            </div>
            <p style="height: 20px;"></p>
            <h4><p> Welcome</p>
                <strong style="font-size: 24px;" th:text="${title}">云宝零批商城管理后台</strong></h4>
        </div>
        <div class="col-sm-5">
            <form id="saveForm" method="post" action="/login">
                <input type="hidden" name="role" value="管理员" th:value="${role}"/>
                <h4 class="no-margins">登录：</h4>
                <input type="text" class="form-control uname" name="username" placeholder="用户名"/>
                <input type="password" class="form-control pword m-b" name="password" placeholder="密码"/>
                <th:block th:if="${session.verifyTag!=null}">
                    <div class="form-inline">
                        <input name="verifyCode" placeholder="验证码" type="text" class="form-control m-t-none"
                               style="color:#000000;float: left;width: 150px;"/>
                        <img th:src="@{/verifyCode}" onclick="LoadVerifyCode(this);"
                             style="width: 73px; height: 34px;float: right;border-radius: 3px;cursor: pointer;"/>
                    </div>

                    <p style="height: 50px;"></p>
                </th:block>

                <button class="btn btn-success btn-block">登录</button>
            </form>
        </div>
    </div>
    <div class="signup-footer">
        <div class="pull-left">
            &copy; 2020 All Rights Reserved.
        </div>
    </div>
</div>
</body>
<script src="http://cdn.viptool.cn/lib/jquery/2.2.4/jquery.min.js"></script>
<script src="../resource/hotui/js/hot/bootstrap.hot.extra-utils.js?20190316"
        th:src="@{/resource/hotui/js/hot/bootstrap.hot.extra-utils.js?20190316}"></script>
<script type="text/javascript" th:inline="javascript">


    var failedFlag = /*[[${failedFlag}]]*/ false;
    var errorMsg = /*[[${errMsg}]]*/ "";
    $(function () {
        if (failedFlag) {
            hot.tip.error(errorMsg);
        }

        $("#saveForm").submit(function () {
            editHandler.clear();
        })
    });

    var baseUrl = /*[[@{/verifyCode}]]*/ "/verifyCode";

    function LoadVerifyCode(obj) {
        $(obj).attr('src', baseUrl + "?rnd=" + Math.random());
    }

    var editHandler = {
        clear: function () {
            localStorage.clear();
        }
    }


</script>
</html>